#include <stdio.h>

typedef struct
{
    int NO;
    float Ti;
}People;

int main()
{
    int n,i,j;
    float sum = 0.0,s = 0.0;
    People a[1000],temp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%f",&(a[i].Ti));
        a[i].NO = i+1;
    }
    for(i=0;i<n-1;i++)
    {
        for(j=0;j<n-1-i;j++)
        {
            if(a[j].Ti>a[j+1].Ti)
            {
                temp = a[j];
                a[j] = a[j+1];
                a[j+1] = temp;
            }
        }
    }
    for(i=0;i<n;i++)
    {
        if(i!=n-1)
            printf("%d ",a[i].NO);
        else
            printf("%d",a[i].NO);
        if(i != 0)
        {
            s += a[i-1].Ti;
            sum += s;
        }
    }
    printf("\n%.2f",sum/10);
    return 0;
}